package com.tarena.day050;
/** 方法的递归调用 */
public class RevDemo {
  public static void main(String[] args) {
    //f(n) = 1+3+5+7+9+...+n
    //
    //f(n) = f(n-2)+n && f(1)=1;
    int n = 8888;
    int y = f(n);
    System.out.println(y);
  }
  public static int f(int n){
    if(n==0)
      return 0;
    return f(n-2)+n;
  }
}




